package com.whj.controller;

import com.whj.annotation.SystemLog;
import com.whj.domain.entity.User;
import com.whj.domain.response.ResponseResult;
import com.whj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @Auther: wanghaijun
 * @Date: 2023/5/25 - 05 - 25 - 16:13 
 * @Description: com.whj.controller
 */

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/userInfo")
    public ResponseResult userInfo() {
        return userService.userinfo();
    }

    @PutMapping("/userInfo")
    @SystemLog(businessName="更新用户信息")
    public ResponseResult updateUserInfo(@RequestBody User user){
        return userService.updateUserInfo(user);
    }

    @PostMapping("/register")
    public ResponseResult register(@RequestBody  User user){
        return userService.register(user);
    }

}

